import request from "@/api/request"

export const getAllPosts=(data)=>{
    return request({
        url:`/post/${data.pageNum}/${data.pageSize}`
    })
}
export const getPostsBySubject=(data)=>{
    return request({
        url:`/post/subject/${data.pageNum}/${data.pageSize}/${data.subject}`
    })
}
export const getOnePost=(id)=>{
    return request({
        url:`/post/${id}`
    })
}
export const getMyPosts=(id)=>{
    return request({
        url:`/post/user/${id}`
    })
}
export const getAllPost1=(data)=>{
    return request({
        url:`/post/time/${data.pageNum}/${data.pageSize}`
    })
}
export const getAllPost2=(data)=>{
    return request({
        url:`/post/click/${data.pageNum}/${data.pageSize}`
    })
}
export const getInforByIdType=(data)=>{
    return request({
        url:'/post/message',
        method:'POST',
        data
    })
}
export const InsertPost=(data)=>{
    return request({
        url:'/post',
        method:'POST',
        data
    })
}
export const InPostClick=(id)=>{
    return request({
        url:`/post/click/${id}`,
        method:'POST',
    })
}
export const deletePostById=(id)=>{
    return request({
        url:`/post/${id}`,
        method:'DELETE',
    })
}